﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NMoq.Core
{
    public class DataProviderSelector : Selector<IDataProvider>
    {
        #region constructors
        public DataProviderSelector()
            : base()
        {
            MethodActionMapper = new Dictionary<int, IDataProvider>();
            ActionAllMethod = false;
            DefaultAction = new DefaultDataProvider();
        }

        public DataProviderSelector(bool actionAllMethod)
            : this()
        {
            ActionAllMethod = actionAllMethod;
        }
        #endregion

        #region overrider method

        public override void Clear()
        {
            base.Clear();
            DefaultAction = new DefaultDataProvider();
        }

        public override IDataProvider Select(MethodMessageInfo methodMessageInfo)
        { 
            return base.Select(methodMessageInfo) ?? DefaultAction;
        }
        #endregion
    }
}
